#include "stdafx.h"
#include <cv.h>
#include <highgui.h>




/*int _tmain(int argc, _TCHAR* argv[])
{
	IplImage* img = cvLoadImage( "Desert.jpg", 0);
	cvNamedWindow( "Example4-in" ,CV_WINDOW_AUTOSIZE);
	cvNamedWindow( "Example4-out" , CV_WINDOW_AUTOSIZE);

	// Show the original image
	cvShowImage("Example4-in", img);

	// Make sure image is divisible by 2
	assert( img->width%2 == 0 && img->height%2 == 0);

	// Create an image for the output
	IplImage* out = cvCreateImage( cvSize(img->width/2,img->height/2), img->depth, img->nChannels );

	// Reduce the image by 2
	cvPyrDown( img, out ,CV_GAUSSIAN_5x5);

	// Perform canny edge detection
	cvCanny( out, out, 10, 100, 3 );

	// Show the processed image
	cvShowImage("Example4-out", out);

	cvWaitKey(0);
	cvReleaseImage( &img );
	cvReleaseImage( &out );
	cvDestroyWindow( "Example4-in" );
	cvDestroyWindow( "Example4-out" );

	return 0;
}*/

int _tmain(int argc, _TCHAR* argv[])
{
	IplImage* img = cvLoadImage( "Desert.jpg" ,1);
	cvNamedWindow( "Example3-in" ,CV_WINDOW_AUTOSIZE);
	cvNamedWindow( "Example3-out" , CV_WINDOW_AUTOSIZE);

	// Show the original image
	cvShowImage("Example3-in", img);

	// Create an image for the output
	IplImage* out = cvCreateImage( cvGetSize(img), IPL_DEPTH_8U, 3 );

	// Perform a Gaussian blur
	cvSmooth( img, out, CV_GAUSSIAN, 11, 11 ,0,0);

	// Show the processed image
	cvShowImage("Example3-out", out);

	cvWaitKey(0);
	cvReleaseImage( &img );
	cvReleaseImage( &out );
	cvDestroyWindow( "Example3-in" );
	cvDestroyWindow( "Example3-out" );
	return 0;
}


